package cn.com.ustudy.course.core.comp.service;

import cn.com.ustudy.course.core.model.entity.Post;
import cn.melonlib.cores.jpa.model.bean.impl.PaginationList;
import cn.melonlib.graphql.annos.GraphqlParameter;
import cn.melonlib.graphql.annos.GraphqlQuery;
import cn.melonlib.graphql.annos.GraphqlSchema;
import cn.melonlib.graphql.model.enums.GraphqlQueryMode;
import cn.melonlib.objects.maps.JsonMap;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@GraphqlSchema
@Service
public class PostService {

    @GraphqlQuery(comment = "分页查询",queryMode = GraphqlQueryMode.OFFSET)
    public PaginationList<Post> search(@GraphqlParameter(value = "first",comment = "数量",required = true) Integer first,
                                       @GraphqlParameter(value = "offset",comment = "偏移量",required = true) Long offset,
                                       @GraphqlParameter(value = "ids",comment = "指定id") List<String> ids,
                                       @GraphqlParameter(value = "filter",comment = "过滤条件") JsonMap<Object> filter){

        return PaginationList.createOffset(Collections.emptyList(),0,0,0);
    }

}
